//  ScrollPageView.h
//  QNReuseTool
//
//  Created by rsh on 2019/10/15.
//  Copyright © 2019年 rsh. All rights reserved.

// MARK: 分页控件

#define LEFT_SPACE 20
#define RIGHT_SPACE 20
#define MIN_SPACING 20
#define TAB_HEIGHT 50
#define LINEBOTTOM_HEIGHT 1
#define TOPBOTTOMLINEBOTTOM_HEIGHT 0.5

#import <UIKit/UIKit.h>

typedef void(^ClickTitleBlock)(NSInteger);

@interface ScrollPageView : UIView

typedef NS_ENUM(NSInteger, ScrollPageViewStyle) {
    ScrollPageViewStyleA,
    ScrollPageViewStyleB
};

/** TitleButton Block */
@property (nonatomic, copy) ClickTitleBlock clickTitleBlock;

// Personalized configuration properties
@property (nonatomic, strong) UIFont *font;
@property (nonatomic, strong) UIColor *selectedColor;
@property (nonatomic, strong) UIColor *unselectedColor;
@property (nonatomic, strong) UIColor *topTabBottomLineColor;
@property (nonatomic, assign) CGFloat leftSpace;
@property (nonatomic, assign) CGFloat rightSpace;
@property (nonatomic, assign) CGFloat minSpace;
@property (nonatomic, assign) NSInteger defaultSubscript;
@property (nonatomic, assign) ScrollPageViewStyle pageViewStyle;
@property (nonatomic,   copy) void (^scrollToPageCallBack)(NSInteger index, UIViewController *viewController);
/**
 default 20.
 For translucent status bar
 */
@property (nonatomic, assign) CGFloat topSpace;
@property (nonatomic, strong) UIButton *leftButton;
@property (nonatomic, strong) UIButton *rightButton;

/**
 default YES.
 */
@property (nonatomic, assign) BOOL isAdapteNavigationBar;
/**
 default NO.
 */
@property (nonatomic, assign) BOOL isAnimated;
/**
 default YES.
 */
@property (nonatomic, assign) BOOL isTranslucent;
/**
 default YES ,Valid when only one page can be filled with all buttons
 */
@property (nonatomic, assign) BOOL isAverage;
/**
 default YES .
 */
@property (nonatomic, assign) BOOL isShowTopTabBottomLine;
/**
 default YES .
 */
@property (nonatomic, assign) BOOL bodyPageBounces;
/**
 default YES .
 */
@property (nonatomic, assign) BOOL bodyPageScrollEnabled;
/**
 default NO .
 */
@property (nonatomic, assign) BOOL topTabBounces;



/**
 Initializes and returns a newly allocated view object with the specified frame rectangle.
 
 @param frame       ...
 @param titles      Some title
 @param controllers Name of some controllers
 @param parameters  You need to set a property called "parameter" for your controller to receive.
 
 @return self
 */
- (instancetype)initWithFrame:(CGRect)frame withTitles:(NSArray *)titles withViewControllers:(NSArray *)controllers withParameters:(NSArray *)parameters;

@end


/**
 *基本用法介绍：控制器中添加
 
 
 - (void)viewInit {
     self.title = @"退换货单";
     CGRect rect = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
     self.pageView = [[ScrollPageView alloc] initWithFrame:rect
                                                withTitles:@[@"退货单", @"换货单"]
                                       withViewControllers:@[@"GB_ManagementFirstController",
                                                             @"GB_ManagementSecondController"]
                                            withParameters:nil];
     self.pageView.pageViewStyle = ScrollPageViewStyleB;
     self.pageView.isTranslucent = NO;
     self.pageView.isAdapteNavigationBar = NO;
     self.pageView.selectedColor = UIColor.whiteColor;
     self.pageView.unselectedColor = UIColor.lightGrayColor;
     self.pageView.font = ASFont(15);
     self.pageView.bodyPageBounces = NO;
     [self.view addSubview:self.pageView];
 }

 
 *
 **/
